package com.ruoyi.know.service.impl;

import com.ruoyi.know.domain.UserLikes;
import com.ruoyi.know.mapper.UserLikesMapper;
import com.ruoyi.know.service.IUserLikesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户点赞Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-05
 */
@Service
public class UserLikesServiceImpl implements IUserLikesService
{
    @Autowired
    private UserLikesMapper userLikesMapper;

    @Override
    public int getCountByLikes(UserLikes userLikes) {
        return userLikesMapper.getCountByLikes(userLikes);
    }

    /**
     * 查询用户点赞
     *
     * @param likeId 用户点赞主键
     * @return 用户点赞
     */
    @Override
    public UserLikes selectUserLikesByLikeId(Long likeId)
    {
        return userLikesMapper.selectUserLikesByLikeId(likeId);
    }

    /**
     * 查询用户点赞列表
     *
     * @param userLikes 用户点赞
     * @return 用户点赞
     */
    @Override
    public List<UserLikes> selectUserLikesList(UserLikes userLikes)
    {
        return userLikesMapper.selectUserLikesList(userLikes);
    }

    /**
     * 新增用户点赞
     *
     * @param userLikes 用户点赞
     * @return 结果
     */
    @Override
    public int insertUserLikes(UserLikes userLikes)
    {
        return userLikesMapper.insertUserLikes(userLikes);
    }

    /**
     * 修改用户点赞
     *
     * @param userLikes 用户点赞
     * @return 结果
     */
    @Override
    public int updateUserLikes(UserLikes userLikes)
    {
        return userLikesMapper.updateUserLikes(userLikes);
    }

    /**
     * 批量删除用户点赞
     *
     * @param likeIds 需要删除的用户点赞主键
     * @return 结果
     */
    @Override
    public int deleteUserLikesByLikeIds(Long[] likeIds)
    {
        return userLikesMapper.deleteUserLikesByLikeIds(likeIds);
    }

    /**
     * 删除用户点赞信息
     *
     * @param likeId 用户点赞主键
     * @return 结果
     */
    @Override
    public int deleteUserLikesByLikeId(Long likeId)
    {
        return userLikesMapper.deleteUserLikesByLikeId(likeId);
    }

    @Override
    public int deleteUserLikesByUserLikes(UserLikes userLikes) {
        return userLikesMapper.deleteUserLikesByUserLikes(userLikes);
    }
}
